import request from '@/utils/request'
//发邮件
export function send (data) {
  return request({
    url: '/mail/send',
    method: 'post',
    data
  })
}
//用户信息修改（包括管理员）
export function senduser (data) {
  return request({
    url: '/user/update',
    method: 'post',
    data
  })
}
//管理员创建用户
export function sendcreate (data) {
  return request({
    url: '/user/create',
    method: 'post',
    data
  })
}
//管理员删除用户资料
export function senddelete (data) {
  return request({
    url: '/user/userdel',
    method: 'post',
    data
  })
}
//查询单个用户
export function sendquery (data) {
  return request({
    url: '/user/info1',
    method: 'get',
  })
}

export function sendqueryall (data) {
  return request({
    url: '/user/allinfo',
    method: 'post',
    data
  })
}

export function getchart (data) {
  return request({
    url: '/user/allinfo',
    method: 'post',
    data
  })
}

export function getUserByUsername (data) {
  return request({
    url: '/user/userinfo',
    method: 'post',
    data
  })
}

export function deleteInfo(data) {
  return request({
    url: '/tran_log/dele',
    method: 'post',
    data
  })
}
export function senddate(data) {
  return request({
    url: '/tran_log/date_tran',
    method: 'post',
    data
  })
}

export function uploadPhoto(titles) {
  var con = {}
  con['title'] = titles
  con = JSON.stringify(con)
  return request({
    url: '/photo/createphoto',
    method: 'post',
    params: { username: titles }
  })
}
